﻿using System.Configuration;

namespace Our.Umbraco.Tree.Elmah.Configuration
{
	public class ElmahSection : ConfigurationSection
	{
		/// <summary>
		/// The name of the 'Elmah' section
		/// </summary>
		internal const string ElmahSectionName = "elmah";

		/// <summary>
		/// Gets the instance.
		/// </summary>
		/// <value>The instance.</value>
		public static ElmahSection Instance
		{
			get
			{
				return ConfigurationManager.GetSection("elmah") as ElmahSection;
			}
		}

		/// <summary>
		/// The name of the 'errorLog' section
		/// </summary>
		internal const string ErrorLogSectionName = "errorLog";

		/// <summary>
		/// Gets or sets the error log.
		/// </summary>
		/// <value>The error log.</value>
		[ConfigurationProperty(ErrorLogSectionName, IsRequired = true, IsKey = false, IsDefaultCollection = false)]
		public ErrorLogSection ErrorLog
		{
			get
			{
				return (ErrorLogSection)base[ErrorLogSectionName];
			}
			set
			{
				base[ErrorLogSectionName] = value;
			}
		}
	}
}
